

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>The iphone module &mdash; pysiriproxy v0.0.7 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '0.0.7',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="pysiriproxy v0.0.7 documentation" href="../index.html" />
    <link rel="up" title="The connections module" href="mod_pysiriproxy_connections.html" />
    <link rel="next" title="The manager module" href="pysiriproxy_connections_manager.html" />
    <link rel="prev" title="The connections module" href="mod_pysiriproxy_connections.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="pysiriproxy_connections_manager.html" title="The manager module"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="mod_pysiriproxy_connections.html" title="The connections module"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">pysiriproxy v0.0.7 documentation</a> &raquo;</li>
          <li><a href="mod_pysiriproxy.html" >The pysiriproxy module</a> &raquo;</li>
          <li><a href="mod_pysiriproxy_connections.html" accesskey="U">The connections module</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-pysiriproxy.connections.iphone">
<span id="the-iphone-module"></span><h1>The iphone module<a class="headerlink" href="#module-pysiriproxy.connections.iphone" title="Permalink to this headline">¶</a></h1>
<p>The iphone module contains the necessary classes for creating a concrete
connection which is responsible for managing the connection between
pysiriproxy and the iPhone.</p>
<div class="section" id="the-iphone-class">
<h2>The _iPhone class<a class="headerlink" href="#the-iphone-class" title="Permalink to this headline">¶</a></h2>
<p class="graphviz">
<img src="../_images/inheritance-8a343fc7f732276b646f7f9655b9d077a86de93c.png" alt="Inheritance diagram of pysiriproxy.connections.iphone._iPhone" usemap="#inheritancea9b305e4ec" class="inheritance"/>
<map id="inheritancea9b305e4ec" name="inheritancea9b305e4ec">
<area shape="rect" href="#pysiriproxy.connections.iphone._iPhone" title="pysiriproxy.connections.iphone._iPhone" alt="" coords="147,316,416,343"/>
<area shape="rect" href="pysiriproxy_connections_connection.html#pysiriproxy.connections.connection.Connection" title="pysiriproxy.connections.connection.Connection" alt="" coords="123,239,440,265"/>
</map>
</p>
<dl class="class">
<dt id="pysiriproxy.connections.iphone._iPhone">
<em class="property">class </em><tt class="descclassname">pysiriproxy.connections.iphone.</tt><tt class="descname">_iPhone</tt><big>(</big><em>logger</em><big>)</big><a class="reference internal" href="../_modules/pysiriproxy/connections/iphone.html#_iPhone"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pysiriproxy.connections.iphone._iPhone" title="Permalink to this definition">¶</a></dt>
<dd><p>The _iPhone class manages the SSL connection to Siri on the iPhone
client. It processes requests from Siri and forwards them to Apple&#8217;s
server, and then intercepts the response and provides the ability to
inject custom responses.</p>
<dl class="method">
<dt id="pysiriproxy.connections.iphone._iPhone.connectionLost">
<tt class="descname">connectionLost</tt><big>(</big><em>reason</em><big>)</big><a class="reference internal" href="../_modules/pysiriproxy/connections/iphone.html#_iPhone.connectionLost"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pysiriproxy.connections.iphone._iPhone.connectionLost" title="Permalink to this definition">¶</a></dt>
<dd><p>Called when the connection is lost.</p>
<ul class="simple">
<li>reason &#8211; The reason the connection was lost</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone._iPhone.connectionMade">
<tt class="descname">connectionMade</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/pysiriproxy/connections/iphone.html#_iPhone.connectionMade"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pysiriproxy.connections.iphone._iPhone.connectionMade" title="Permalink to this definition">¶</a></dt>
<dd><p>Called when a connection is made.</p>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone._iPhone.reconnectServer">
<tt class="descname">reconnectServer</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/pysiriproxy/connections/iphone.html#_iPhone.reconnectServer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pysiriproxy.connections.iphone._iPhone.reconnectServer" title="Permalink to this definition">¶</a></dt>
<dd><p>Disconnect and then re-connect the server connection.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="the-connection-class">
<h2>The Connection class<a class="headerlink" href="#the-connection-class" title="Permalink to this headline">¶</a></h2>
<p class="graphviz">
<img src="../_images/inheritance-7014cafca613d287df0ae8afbec89c7742a665e5.png" alt="Inheritance diagram of pysiriproxy.connections.iphone.Connection" usemap="#inheritance74611e7936" class="inheritance"/>
<map id="inheritance74611e7936" name="inheritance74611e7936">
<area shape="rect" href="pysiriproxy_connections_connection.html#pysiriproxy.connections.connection.Connection" title="pysiriproxy.connections.connection.Connection" alt="" coords="117,239,435,265"/>
</map>
</p>
<dl class="class">
<dt id="pysiriproxy.connections.iphone.Connection">
<em class="property">class </em><tt class="descclassname">pysiriproxy.connections.iphone.</tt><tt class="descname">Connection</tt><big>(</big><em>name</em>, <em>direction</em>, <em>logger</em>, <em>logColor=0</em><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection" title="Permalink to this definition">¶</a></dt>
<dd><p>The Connection class implements the base functionaltiy for creating
a concrete twisted internet protocol which is able to receive data in
the form of lines.</p>
<p>This base class implements the functionality of receiving data from the
iPhone or from Apple&#8217;s web server. The iPhone Apple&#8217;s web server transmit
plist objects which are compressed using zlib compression. This class
implements the necessary functionality for receiving the data, and
decompressing it to retrieve the plist object data that is being
transmitted.</p>
<p>The Connection objects are connected to the
<tt class="xref py py-class docutils literal"><span class="pre">connections.ConnectionManager</span></tt> which provides the ability for
one Connection to forward data to another Connection.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This class is intended to be subclassed to create a connection
between two specific machines.</p>
</div>
<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.connectionFailed">
<tt class="descname">connectionFailed</tt><big>(</big><em>reason</em><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.connectionFailed" title="Permalink to this definition">¶</a></dt>
<dd><p>This function is called when a connection failed.</p>
<ul class="simple">
<li>reason &#8211; The reason the connection was lost</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.connectionLost">
<tt class="descname">connectionLost</tt><big>(</big><em>reason</em><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.connectionLost" title="Permalink to this definition">¶</a></dt>
<dd><p>This function is called when a connection is lost.</p>
<ul class="simple">
<li>reason &#8211; The reason the connection was lost</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.connectionMade">
<tt class="descname">connectionMade</tt><big>(</big><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.connectionMade" title="Permalink to this definition">¶</a></dt>
<dd><p>This function is called when a connection is made.</p>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.getConnectionManager">
<tt class="descname">getConnectionManager</tt><big>(</big><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.getConnectionManager" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the ConnectionManager object for this Connection.</p>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.getDirection">
<tt class="descname">getDirection</tt><big>(</big><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.getDirection" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the direction for this connection.</p>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.getMode">
<tt class="descname">getMode</tt><big>(</big><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.getMode" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the current receiving mode the server is in.</p>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.getRefId">
<tt class="descname">getRefId</tt><big>(</big><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.getRefId" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the most recently used reference id.</p>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.injectObjectToOutputStream">
<tt class="descname">injectObjectToOutputStream</tt><big>(</big><em>obj</em><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.injectObjectToOutputStream" title="Permalink to this definition">¶</a></dt>
<dd><p>Inject the given object into the output stream of this
connection. This effectively sends the object to the foward destination
connection for this connection.</p>
<ul class="simple">
<li>obj &#8211; The object to inject into the output stream</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.lineReceived">
<tt class="descname">lineReceived</tt><big>(</big><em>line</em><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.lineReceived" title="Permalink to this definition">¶</a></dt>
<dd><p>This function is called when a line of data is received.</p>
<ul class="simple">
<li>line &#8211; The line of data</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.rawDataReceived">
<tt class="descname">rawDataReceived</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.rawDataReceived" title="Permalink to this definition">¶</a></dt>
<dd><p>This function is called when raw data is received.</p>
<ul class="simple">
<li>data &#8211; The raw data</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.reset">
<tt class="descname">reset</tt><big>(</big><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.reset" title="Permalink to this definition">¶</a></dt>
<dd><p>Reset this connection.</p>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.setLineMode">
<tt class="descname">setLineMode</tt><big>(</big><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.setLineMode" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the server to receive lines.</p>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.setRawMode">
<tt class="descname">setRawMode</tt><big>(</big><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.setRawMode" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the server to receive raw data.</p>
</dd></dl>

<dl class="method">
<dt id="pysiriproxy.connections.iphone.Connection.setRefId">
<tt class="descname">setRefId</tt><big>(</big><em>refId</em><big>)</big><a class="headerlink" href="#pysiriproxy.connections.iphone.Connection.setRefId" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the reference id.</p>
<ul class="simple">
<li>refId &#8211; The reference id</li>
</ul>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="the-factory-class">
<h2>The _Factory class<a class="headerlink" href="#the-factory-class" title="Permalink to this headline">¶</a></h2>
<p class="graphviz">
<img src="../_images/inheritance-b41f1d19533ec92ebf5a1be554ebdfce012fef46.png" alt="Inheritance diagram of pysiriproxy.connections.iphone._Factory" usemap="#inheritance9f45eddff6" class="inheritance"/>
<map id="inheritance9f45eddff6" name="inheritance9f45eddff6">
<area shape="rect" href="#pysiriproxy.connections.iphone._Factory" title="pysiriproxy.connections.iphone._Factory" alt="" coords="5,84,277,111"/>
</map>
</p>
<dl class="class">
<dt id="pysiriproxy.connections.iphone._Factory">
<em class="property">class </em><tt class="descclassname">pysiriproxy.connections.iphone.</tt><tt class="descname">_Factory</tt><big>(</big><em>logger</em><big>)</big><a class="reference internal" href="../_modules/pysiriproxy/connections/iphone.html#_Factory"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pysiriproxy.connections.iphone._Factory" title="Permalink to this definition">¶</a></dt>
<dd><p>The _Factory class is responsible for creating an _iPhone connection.</p>
<dl class="method">
<dt id="pysiriproxy.connections.iphone._Factory.buildProtocol">
<tt class="descname">buildProtocol</tt><big>(</big><em>addr</em><big>)</big><a class="reference internal" href="../_modules/pysiriproxy/connections/iphone.html#_Factory.buildProtocol"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pysiriproxy.connections.iphone._Factory.buildProtocol" title="Permalink to this definition">¶</a></dt>
<dd><p>build the protocol for an _iPhone connection.</p>
<ul class="simple">
<li>_addr &#8211; The address</li>
</ul>
</dd></dl>

</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">The iphone module</a><ul>
<li><a class="reference internal" href="#the-iphone-class">The _iPhone class</a></li>
<li><a class="reference internal" href="#the-connection-class">The Connection class</a></li>
<li><a class="reference internal" href="#the-factory-class">The _Factory class</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="mod_pysiriproxy_connections.html"
                        title="previous chapter">The connections module</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="pysiriproxy_connections_manager.html"
                        title="next chapter">The manager module</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/_generated/pysiriproxy_connections_iphone.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="pysiriproxy_connections_manager.html" title="The manager module"
             >next</a> |</li>
        <li class="right" >
          <a href="mod_pysiriproxy_connections.html" title="The connections module"
             >previous</a> |</li>
        <li><a href="../index.html">pysiriproxy v0.0.7 documentation</a> &raquo;</li>
          <li><a href="mod_pysiriproxy.html" >The pysiriproxy module</a> &raquo;</li>
          <li><a href="mod_pysiriproxy_connections.html" >The connections module</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2012, Brett Ponsler.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
    </div>
  </body>
</html>